//
// Created by lau on 2019-10-17.
//

#include "context.h"
#include "ve_core.h"
#include "utils/logutils.h"

namespace VideoEffect {

    Context::Context() {
//        mGrayFilter = new GrayFilter();
//        mGrayFilter->setContext(this);
//        mGrayFilter->initFilter();
        mBeautyFilter = new BeautyFilter();
        mBeautyFilter->setContext(this);
        mBeautyFilter->initFilter();
    }

    void Context::rendFrame(VE_Texture *textureIn, VE_Texture *textureOut) {
//        mGrayFilter->rendFrame(textureIn, textureOut);
        mBeautyFilter->rendFrame(textureIn, textureOut);
    }

    Render *Context::getRender() {
        if (mRender == nullptr) {
            mRender = new Render();
        }
        return mRender;
    }

    FrameBuffer *Context::getFrameBuffer() {
        if (mFrameBuffer == nullptr) {
            mFrameBuffer = new FrameBuffer();
        }
        return mFrameBuffer;
    }

}